package com.shuaigef.springbootinit.controller;

import com.shuaigef.springbootinit.common.BaseResponse;
import com.shuaigef.springbootinit.common.ResultUtils;
import com.shuaigef.springbootinit.model.vo.GetPaperErrorRateVO;
import com.shuaigef.springbootinit.service.PaperService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
// 
import java.util.List;

@RestController("/paper")
@RequiredArgsConstructor
public class PaperController {
    private final PaperService paperService;

    /**
     * 获取试卷的错误率情况
     * 
     * @param paperId 试卷id
     * @return 错误率
     */
    @GetMapping("/getPaperErrorRate/{paperId}")
    public BaseResponse<List<GetPaperErrorRateVO>> getPaperErrorRate(@PathVariable Integer paperId) {
        List<GetPaperErrorRateVO> result = paperService.getPaperErrorRate(paperId);
        return ResultUtils.success(result);
    }
}
